/* Expression types */
#define TYPE_INTEGER    1
#define TYPE_FLOAT      2
#define TYPE_STRING     3
#define TYPE_BOOL       4
#define TYPE_OP         5
#define TYPE_IDENTIFIER 6

/* Mathematical Operations */
#define OP_ADD       1
#define OP_SUBTRACT  2
#define OP_MULTIPLY  3
#define OP_DIVIDE    4
#define OP_POWER     5
#define OP_MODULO    6
#define OP_ASSIGN    7
#define OP_NEGATE    8

/* Logical Operations */
#define OP_GT        9
#define OP_LT        10
#define OP_GE        11
#define OP_LE        12
#define OP_NE        13
#define OP_AND       14
#define OP_OR        15
#define OP_XOR       16
#define OP_NOT       17
#define OP_PP        18
#define OP_LG        19

class Expr { /* Represents a boql expression */
 public:
  Expr (unsigned int exprType, char *data);
  Expr (unsigned int exprType, unsigned int op, Expr *left, Expr *right = NULL);

  void appendExpr (Expr *expr);

 private:
  string value;

  unsigned int type;
  unsigned int operation; /* applied between first two elements of 
                                   exprList if type = TYPE_OP */

  vector<Expr*> exprList;
};
